package test;
import java.util.Map;

// -XX:+HeapDumpOnOutOfMemoryError -Xms10m -Xmx15m
// 在项目根目录会生成dump文件，用MAT打开分析
public class MemLeak {

    public final String key;
    public MemLeak(String key) {
        this.key =key;
    }

    public static void main(String args[]) {
        try {
            Map map = System.getProperties();
            for(;;) { // line 14
                map.put(new MemLeak("key"), "value");
            }
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
}